package com.starling.core
{
	import com.starling.utils.TextureUtil;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.text.TextField;

	public class InfoSprite
	{
		public static function getInfo(mc:MovieClip ,scale:Number):Array
		{
			var length:int = mc.numChildren;
			var infos:Array = [];
			for (var i:int=0;i<length;i++)
			{
				var child:DisplayObject = mc.getChildAt(i);
				var childName:String = TextureUtil.getClassName(child);
				var childType:String = TextureUtil.getClassType(childName);
				if(childType == null)continue;
				
				var infoObj:Object = InfoDisplay.getInfo(child ,scale);
				infoObj.textureName = childName;
				infoObj.textureType = childType;
				
				//追加文本信息
				if(child is TextField)
				{
					infoObj.textureName = child.name;
					infoObj.textInfo = InfoTextField.getInfo(child as TextField);
				}
				
				//如果是组件则追加组件信息
				infoObj.compInfo = InfoComponents.getInfo(childType ,child);
				
				infos.push(infoObj);
			}
			
			return infos;
		}
	}
}